<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateUsersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('users', function (Blueprint $table) {
            $table->increments('id');
            $table->string('account', 11)->unique()->comment('账号');
            $table->string('user_name')->comment('昵称');
            $table->string('password')->default(encrypt('666666'))->comment('密码');
            $table->tinyInteger('status')->comment('用户类型');
            $table->integer('rating')->comment('积分值')->default(0);
            $table->softDeletes()->comment('软删除字段');
            $table->rememberToken();
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('users');
    }
}
